package src.lab04.test04;

/**
 * Created by 阿阿阿阿豪丶 on 2017/12/19.
 */
public class First implements Runnable{
    @Override
    public void run() {
        //4、 	创建三个线程，每个线程的功能是完成计数功能即向控制台依次递减的输出5，4，3，2，1。观察运行结果并分析原因。
        while (true){
            try {
                Thread.sleep(500);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }

            System.out.println("5");
            try {
                Thread.sleep(500);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("4");
            try {
                Thread.sleep(500);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("3");
            try {
                Thread.sleep(500);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("2");
            try {
                Thread.sleep(500);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("1");
        }
    }
}